package net.jalbum.filters.arty;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

/**
 *
 * @author Sarah Schölzel
 */
class ArtyControl extends FilterControl {

    private ArtyPlugin artyPlugin;

    /**
     * Constructor
     * @param plugin 
     */
    public ArtyControl(ArtyPlugin plugin) {
        init(plugin);
        initComponents();
    }

    protected void init(ArtyPlugin plugin) {
        artyPlugin = plugin;
        super.init(artyPlugin);
    }

    /**
     * initializes the components
     */
    private void initComponents() {
        ArtySelector selector = new ArtySelector();
        selector.addPropertyChangeListener(ArtySelector.EFFECT_PROPERTY, new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent pce) {
                artyPlugin.setEffect((Effect)pce.getNewValue());
            }
        });
        
        add("center", selector);

      
    }
}

